package com.googlecode.jlsf;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;

/**
 * invokes shoutcast's ports scanner on hosts checked and marked as 'alive' by pinger
 */
public class PingerListener 
{
	private static ExecutorService pool = Executors.newCachedThreadPool();

	synchronized public static void submitShoutcastThread(String ip)
	{
		pool.submit(new Shoutcast(ip));
	}
	
	synchronized public static void shutdownAllShoutcastThreads()
	{
		pool.shutdown();
	}
	
	synchronized public static int getActiveShoutcastThreadsCount()
	{
		return ((ThreadPoolExecutor) pool).getActiveCount();
	}
	
}
